<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./TemplatePrincipal.xhtml">

            <ui:define name="top">
                top
            </ui:define>

            <ui:define name="left">
                <h:form>
                <p:commandButton action="PrincipalMenu" value="Menu Principal"/>
                </h:form>
            </ui:define>

            <ui:define name="content">
                
                <f:view>
                    <h:form>
                        <h1>
                            <h:outputText value="Create/Edit"/></h1>
                        <p:panelGrid columns="2">
                         
                            <h:outputLabel value="Clave:" for="clave" />
                            <p:inputText id="clave" value="#{categoriaBean.categoria.clave}" title="Clave" required="true" requiredMessage="The Clave field is required.">
                                  <f:validateDoubleRange minimum="10" maximum="100000"/>
                                </p:inputText>
                            <h:outputLabel value="Descripcion:" for="descripcion" />
                            <p:inputText id="descripcion" value="#{categoriaBean.categoria.descripcion}" title="Descripcion" required="true" requiredMessage="The Descripcion field is required.">
                                 <f:validateRegex pattern="[a-z/A-Z]+"/>
                                </p:inputText>
                            <h:outputLabel value="Color:" for="color" />
                            <p:inputText id="color" value="#{categoriaBean.categoria.color}" title="Color" />
                            </p:panelGrid>
                            <p:commandButton action="CategoriaConfirmar" value="Aceptar" ajax="false"/>
                            <p:commandButton action="CategoriaList" value="Cancelar" 
                                             immediate="true" ajax="false"/>
                        
                    </h:form>
                </f:view>


            </ui:define>

        </ui:composition>

    </body>
</html>
